package object.warpper;

public class IntegerDemo1 {
    public static void main(String[] args) {
        int a=128;
        //将基本类型变成对应的包装类
        //Integer i1=new Integer(a);
        //Integer i2=new Integer(a);
        //对于Integer而言，valueof总是重用一字节之内的整数对象
        Integer i1=Integer.valueOf(a);
        Integer i2=Integer.valueOf(a);
        System.out.println(i1);
        System.out.println(i2);
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));

        double d=125.33;
        Double d1=Double.valueOf(d);
        Double d2=Double.valueOf(d);
        System.out.println(d1==d2);
        System.out.println(d1.equals(d2));

        int i=i1.intValue();
        double dd=i1.doubleValue();
        byte b=i1.byteValue();
        System.out.println(i);
        System.out.println(dd);
        System.out.println(b);
    }
    public static void test(){

    }
}
